<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		
		<script type="text/javascript">
			function setMatcher(preFilter, matcher, postFilter, postFinder){
				if(postFilter != null){
					postFilter = setMatcher(postFilter, null, null, null);
				}
				if(postFinder != null){
					postFinder = setMatcher(postFinder, null, null, null);	
				}
				
				return function(){
					// Run preFilter
					console.log("run preFilter")
				
					// Run matcher
					console.log('matcher');
					
					if(psotFilter != null){
						postFilter();
					}
					
					if(postFinder != null){
						postFinder();
					}
				}
			}
			
			var fnNew = setMatcher([],[],null,setMatcher([],[],null, null));
			console.log(fnNew); 
		</script>
	</body>
</html>
